package com.bookRecommend.mapper;

import com.bookRecommend.model.Comment;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Administrator
* @description 针对表【comment(评论记录表)】的数据库操作Mapper
* @createDate 2022-07-20 21:59:03
* @Entity .Comment
*/
public interface ICommentMapper {

    @Select("select comment.*,book.bookname,user.username from comment join user on (user.id = comment.userid) join book on (book.id = comment.bookid)")
    List<Comment> selectComments();

    @Delete("delete from comment where id = #{id}")
    int deleteById(Integer id);


}




